Colorize Command

February 19, 2023

Last updated on October 31, 2026

The Colorize command applies colorized syntax highlighting to selected source code. Supported languages include

 

    • Arduino
    • AutoHotkey
    • Bash
    • Batch
    • C#
    • C++
    • CSS
    • Go
    • HTML
    • Java
    • JavaScript/JSON
    • Onetastic
    • Pascal
    • PHP
    • PlantUML
    • PowerShell
    • Python
    • R
    • Rust
    • Scala
    • SQL
    • Typescript
    • VB
    • Verilog
    • VHDL
    • Windows Registry
    • Wolfram
    • XML
    • YAML

 

See full syntax examples in this PDF file.

 

Shortcut

The Colorize button is available under the OneMore ribbon tab. But there is a faster keyboard shortcut: press Alt + C to display the Select Language dialog.

 

 

You can quickly get to a language by typing the first letter of its name and apply syntax highlighting by pressing Enter. Close the dialog and cancel the action by pressing Esc.


If you've hidden languages in Settings, but need to use one of them temporarily, click Show all languages to see them in the list. This doesn't change settings and only lasts until you close the dialog.

 

Choose the default font to apply to selected text from Settings > Colorizer.

 

Caveats

The highlighting does not guarantee 100% completeness for every language, but then OneNote isn't intended to be a programming editor anyway.

 

For versions prior to 8.1.0

The parser will colorize one paragraph at a time. For example, an XML opening tag and its attributes must all appear in one contiguous paragraph or they will be ignored.

 

<address

  street="123 Main St"

  city="Anytown" />

 

Since that XML is spread across three separate lines (three paragraphs in OneNote) it will not be recognized as XML. But if it were on a single line, then it will be recognized, such as

 

<address street="123 Main St" city="Anytown" />

 

#Planned for future release, OneMore version 8.1.0

This should be resolved in 8.1.0 - OneMore will recognize XML and HTML elements written across multiple lines.

 

Known Limitations

Three limitations in JavaScript and C# remain, that cannot be fixed within this engine:

 

  • JS regex literals containing */: a literal like /,\s*/ makes the whole line look like a comment. The existing rule that detects the end of a multi-line comment (*/ at the start of a line) can't be told apart from it, and its match starts at the line's first character, so it always wins. The sample showed const parts = 'a,b'.split(/,\s*/); colored as a comment.
  • JS nested template literals: a ${`b ${c}`} is split into pieces.
  • C# [module: SuppressMessage("a", "b")]: only the first string is colored.

 

Definition Files

Languages are defined in JSON definition files located below the OneMore installation directory so they can be customized and enhanced and new languages can be added. If you're so inclined to add enhancements or define a new language, please submit a pull request.

 

 

#omwiki #omcommands

 

© 2020 Steven M Cohn. All rights reserved.

Please consider a sponsorship or one-time donation to support ongoing development

 

Created with OneNote.